Ignoring Files
To exclude specific files or patterns from being processed by the MadQualityPluginII, you can utilize the .mqignore
file. This file functions similarly to a .gitignore
file, allowing you to specify which files the plugin should ignore during its operations.
Creating and Configuring the .mqignore
File
-
Create the
.mqignore
File:- You can place a
.mqignore
file in the root directory of your project (where the.flprj
file is located) or in any subdirectory where you want specific ignore rules to apply. - The plugin checks
.mqignore
files hierarchically, starting from the file's directory and walking up to the project root.
- You can place a
-
Edit the
.mqignore
File:- Open the
.mqignore
file in a text editor like Notepad. - Add the filenames or patterns of the files you wish to exclude from processing. Each pattern or filename should be on a new line.
- Open the
Examples of .mqignore
Entries
-
Ignore a Specific File: To ignore a specific file, simply add its name to the
.mqignore
file. For example, to ignoreMySnippet.flsnp
, add the following line:MySnippet.flsnp
-
Ignore All Files of a Specific Type: To ignore all files of a particular type, use a wildcard
*
. For example, to ignore all.flsnp
files, add this line:*.flsnp
-
Ignore Files in a Specific Subdirectory: To ignore all files within a specific subdirectory, include the directory name followed by a backslash and a wildcard. For example, to ignore all files in the
JAN
subdirectory:\JAN\*
Note: You can use either forward slashes (
/
) or backslashes (\
) - the plugin will handle both. -
Ignore Files Based on Complex Patterns: You can use standard glob patterns to match multiple files. For example, to ignore all XML files that start with
temp_
:temp_*.xml
Practical Example
Consider this project structure:
MyProject\
MyProject.flprj
.mqignore (contains: \Temp\*)
Content\
.mqignore (contains: \JAN\*)
Topics\
MyTopic.htm (processed)
JAN\
Read_the_manual.htm (ignored by Content\.mqignore)
Temp\
Draft.htm (ignored by root .mqignore)
When processing Read_the_manual.htm
:
- Plugin checks
Content\JAN\
- no.mqignore
found - Plugin checks
Content\
- finds.mqignore
with\JAN\*
pattern - File matches pattern
Content\JAN\*
→ File is ignored
How It Works
- When the Mad Quality Plugin processes a file, it searches for
.mqignore
files starting from the file's directory and walking up the directory tree. - The search continues until it either:
- Finds a matching ignore pattern in any
.mqignore
file (the file is then ignored), or - Reaches the project root directory (where the
.flprj
file is located) without finding a match (the file is processed)
- Finds a matching ignore pattern in any
- If a file matches any pattern in any
.mqignore
file along the path, it is excluded from all plugin processing activities. - This hierarchical approach allows you to have different ignore rules at different levels of your project:
- Place a
.mqignore
in your project root for project-wide ignore patterns - Place additional
.mqignore
files in subdirectories for folder-specific ignore patterns
- Place a
- The plugin will never search outside your project root (beyond the
.flprj
file location) - This setup helps in focusing the quality checks on relevant files and can improve processing times by skipping unnecessary files.
Best Practices
- Regular Updates: Keep the
.mqignore
file updated as new files or directories are added to your project that you wish to ignore. - Use Comments: You can add comments in your
.mqignore
file by starting the line with a#
. This is useful for documenting why certain files or patterns are ignored.# Ignore backup snippets
*.bak
By properly configuring the .mqignore
file, you can efficiently manage which files are processed by the Mad Quality Plugin, ensuring that the plugin's operations are both relevant and optimized for your project's needs.